// 引入ajax
import utils from "./utils.js";

let baseUrl = "http://website.bluej.cn";
let api = {
    // 登录接口
    login:baseUrl + "/api/admin/login",
    // banner:baseUrl + "/api/carouselGroup/getAllCarouselGroup",
    // 新闻接口
    news:baseUrl + "/api/news/getAll",
    // 关于我们接口
    aboutUs:baseUrl + "/api/aboutUs/getAll",
    // 获取某个轮播图分组下的图片 接口
    banner:baseUrl + "/api/carouselGroup/get",
    // 案例接口
    Focus: baseUrl + "/api/case/getAll",
    // 招聘接口
    recruit:baseUrl + "/api/recruit/getAll",
    // 获取所有轮播图的图片接口
    bannerAll:baseUrl + "/api/carouselGroup/getAllCarouselGroup",
};


// 登录请求
export function login(){
    let data = {
        phone:'13660234827',
        password:'Huanyou4827',
    };
    return utils.myAjax(api.login,"POST",data);
};
// 轮播图请求
// export function getBanner(token){
//     let data = {};
//     return utils.myAjax(api.banner,"GET",data,token);
// };


// 获取所有新闻模块数据请求
export function getNewAll(){
    let data = {
        "limit":50,
        "offset":0,
    };
    let token = localStorage.getItem('token');
    return utils.myAjax(api.news,"GET",data,token);
}


// 获取所有 关于我们模块数据请求
export function getAboutAll(){
    let data = {
        "limit":50,
        "offset":0,
    };
    let token = localStorage.getItem('token');
    return utils.myAjax(api.aboutUs,"GET",data,token);
}


// 获取校园招聘 轮播图模块数据请求
export function getCampusBanner(){
    let data = {
        "carouselGroupId":1092,
    };
    let token = localStorage.getItem('token');
    return utils.myAjax(api.banner,"GET",data,token);
}

// 获取校园招聘 轮播图模块数据请求
export function getSearchBanner(){
    let data = {
        "carouselGroupId":1086,
    };
    let token = localStorage.getItem('token');
    return utils.myAjax(api.banner,"GET",data,token);
}

// 获取人物志 轮播图模块 数据请求
export function getRecruitBannerAll(){
    let data = {
        carouselGroupId:1119,
    };
    let token = localStorage.getItem('token');
    return utils.myAjax(api.banner,"GET",data,token);
}

// 获取所有 招聘模块 的数据请求
export function getRecruitAll(){
    let data = {
        limit:100,
        offset:0,
    };
    let token = localStorage.getItem("token");
    return utils.myAjax(api.recruit,"GET",data,token);
};

// 关注员工成长请求
export function focus() {
    let data2 = {
      "limit":100,
      "offset":0,
    };
    let token = localStorage.getItem('token');
    return utils.myAjax(api.Focus, "GET", data2, token);
  }
  
// 社会招聘
export function faq(token){
    let data3 = {
        "limit":100,
        "offset":0,
    };
    return utils.myAjax(api.news, "GET", data3, token);
}
// 获取所有 轮播图 的数据请求
export function getBannerAll(){
    let data = {
        "limit":100,
        "offset":0,
    };
    let token = localStorage.getItem('token');
    return utils.myAjax(api.bannerAll, "GET", data, token);
}